Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Dependency Selector Syntax & npm query #564

Closed
wants to merge 4 commits into from

Conversation

darcyclarke
Copy link
Contributor

@darcyclarke darcyclarke commented Mar 30, 2022

Rendered RFC* Updated

Overview

  • introduces new "Dependency Selector Syntax"
  • introduces new .querySelectorAll() method to Nodes returned from Arborist
  • introduces new top-level command npm query

@darcyclarke darcyclarke added the Agenda will be discussed at the Open RFC call label Mar 30, 2022
@bnb bnb mentioned this pull request Mar 30, 2022
Co-authored-by: Tierney Cyren <accounts@bnb.im>
accepted/0000-dependency-selector-syntax.md Show resolved Hide resolved
accepted/0000-dependency-selector-syntax.md Show resolved Hide resolved
accepted/0000-dependency-selector-syntax.md Outdated Show resolved Hide resolved
accepted/0000-dependency-selector-syntax.md Outdated Show resolved Hide resolved
accepted/0000-dependency-selector-syntax.md Show resolved Hide resolved
accepted/0000-dependency-selector-syntax.md Outdated Show resolved Hide resolved
accepted/0000-dependency-selector-syntax.md Outdated Show resolved Hide resolved
accepted/0000-dependency-selector-syntax.md Show resolved Hide resolved
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Comment on lines +37 to +38
- `.` class selector
- `:` pseudo class selector
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i still think these need to be named without the word "class".

#### Example of an `Object`:
```css
/* return dependencies that have a `scripts.test` containing `"tap"` */
*:attr(:scripts([test~=tap]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to add an example with a quoted key as well

#### Example of an `Array` Attribute Selection:
```css
/* return dependencies that have a keyword that begins with "react" */
*:attr(:keywords([item^="react"]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be ideal to pick something that can't visually be confused with an object key - pretty much anything that, as an object key, would be forced to be quoted, would be a clear indicator that "keywords" is an array instead of an object

@hemanth
Copy link

hemanth commented Jun 8, 2022

It would be great to have Tab Completion on quires! [Should that also be an RFC in itself?]

@bnb
Copy link

bnb commented Jun 8, 2022

It would be great to have Tab Completion on quires! [Should that also be an RFC in itself?]

I would expect this to be a follow-up RFC and not part of the core feature RFC.

ruyadorno added a commit to npm/cli that referenced this pull request Jun 8, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
ruyadorno added a commit to npm/cli that referenced this pull request Jun 8, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
ruyadorno added a commit to npm/cli that referenced this pull request Jun 9, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
wraithgar pushed a commit to npm/cli that referenced this pull request Jun 22, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
wraithgar pushed a commit to npm/cli that referenced this pull request Jun 23, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
wraithgar pushed a commit to npm/cli that referenced this pull request Jun 23, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
wraithgar pushed a commit to npm/cli that referenced this pull request Jun 28, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
wraithgar pushed a commit to npm/cli that referenced this pull request Jul 13, 2022
Implemented Arborist `querySelectorAll` method that enables easier
retrieval of installed packages using a css-selector-like syntax.

It also includes a new command `npm query` that exposes that same logic
to users of the npm cli.

Ref: npm/rfcs#564
@darcyclarke darcyclarke added ratify and removed Agenda will be discussed at the Open RFC call labels Aug 3, 2022
@nickserv
Copy link

nickserv commented Jan 2, 2023

npm query has already been released.

@darcyclarke darcyclarke closed this Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants